import React from 'react'
import {Col, Form} from 'antd'
const FormItem = Form.Item

export default {
  colWrapper(formItem, field) {
    return (getFieldDecorator, forUpdate, keysToUpdate) => {
      if (forUpdate === true && keysToUpdate && !keysToUpdate.has(field.key)) {
        console.log(field, keysToUpdate)
        return null;
      }

      return (
        <Col key={field.key} sm={8}>
          <FormItem key={field.key} label={field.title} labelCol={{ span: 10 }} wrapperCol={{ span: 14 }}>
            {formItem(getFieldDecorator, forUpdate)}
          </FormItem>
        </Col>
      );
    };
  },
}